<!-- This file interprets libs.xml and generates a utility Ant file to
     register the dependencies with Maven. -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:artifact="antlib:org.apache.maven.artifact.ant"
                version="1.0">
  <xsl:template match="/">
    <project default="default">
      <property file="../build.properties" />
      <path id="maven-ant-tasks.classpath"
            path="../lib/maven-ant-tasks-2.1.1.jar" />
      <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
               uri="antlib:org.apache.maven.artifact.ant"
               classpathref="maven-ant-tasks.classpath" />
      <target name="default">
        <xsl:apply-templates />
      </target>
    </project>
  </xsl:template>
  <xsl:template match="/libs/lib">
    <artifact:pom id="{@id}-pom"
                  artifactId="{@id}" 
                  groupId="{@org}" 
                  version="{@ver}"  />
    <artifact:writepom pomRefId="{@id}-pom" file="{@id}-pom.xml" />                       
    <artifact:install file='{@dir}/{@id}-{@ver}.jar'>
      <pom file="{@id}-pom.xml" />
    </artifact:install>        
  </xsl:template>
</xsl:stylesheet>
